home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2979 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  918 b 

  1. Path: nic.wat.hookup.net!news
  2. From: xenon@the-fix.sos.on.ca
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Is it possible?
  5. Date: Wed, 24 Jan 1996 21:59:27 GMT
  6. Organization: HookUp Communication Corporation, Waterloo, Ontario, CANADA
  7. Message-ID: <4e6auv$usc@nic.wat.hookup.net>
  8. References: <4e5kuq$9i7@news.ust.hk>
  9. NNTP-Posting-Host: slip2.sos.on.ca
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. ee_chung@uxmail.ust.hk (Chu Shiu Chung) wrote:
  13.  
  14.  
  15. >Hello,
  16.  
  17. >     If I have declare the following:
  18. >          #define FILENUM  12
  19.  
  20. >     Is it possible to make the compiler to replace this in printf:
  21. >           printf("FILENUM is the number of files");
  22.     This won't work.  It is read as a literal sting.  Only characters such
  23. as, / and " are special in a printf statement.
  24.  
  25.  
  26. >instead of
  27. >           printf("%d is the number of files", FILENUM);
  28.  
  29. >Just like what the compiler do in: int a=FILENUM;
  30.  
  31. >     Thanks! :>
  32.  
  33. >C.S.C.
  34. xenon@sos.on.ca    
  35.  
  36.